package com.jwgf.faultnavigation;

import com.jwgf.smarowindingmachine_unity.R;
import com.jwgf.smarowindingmachine_unity.logic.MachineParameterSharedPreference;

import java.util.HashMap;

public class FaultNavigationMap {
    private static final FaultNavigationMap ourInstance = new FaultNavigationMap();
    private HashMap<Integer, FaultNavigationAttr> map = new HashMap<>();

    public static FaultNavigationMap getInstance() {
        return ourInstance;
    }

    public FaultNavigationAttr get(int code) {
        return map.get(code);
    }

    private FaultNavigationMap() {
        // 单锭报警
        FaultNavigationAttr attr630102 = new FaultNavigationAttr(R.string.e630102, 0x630102);
        attr630102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630102_img00}, R.string.e630102_detail0));
        attr630102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630102_img10}, R.string.e630102_detail1));
        attr630102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630102_img20, R.drawable.e630102_img21}, R.string.e630102_detail2));
        attr630102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630102_img30, R.drawable.e630102_img31}, R.string.e630102_detail3));
        attr630102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630102_img40}, R.string.e630102_detail4));
        map.put(0x630102, attr630102);

        FaultNavigationAttr attr630103 = new FaultNavigationAttr(R.string.e630103, 0x630103);
        attr630103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630103_img00}, R.string.e630103_detail0));
        attr630103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630103_img10}, R.string.e630103_detail1));
        attr630103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630103_img20, R.drawable.e630103_img21}, R.string.e630103_detail2));
        attr630103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630103_img30}, R.string.e630103_detail3));
        attr630103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630103_img40}, R.string.e630103_detail4));
        map.put(0x630103, attr630103);

        FaultNavigationAttr attr630104 = new FaultNavigationAttr(R.string.e630104, 0x630104);
        int mt = Integer.parseInt(MachineParameterSharedPreference.getInstance()
                .getValue(MachineParameterSharedPreference.MACHINE_MACHINE_TYPE, "0"));
        switch (mt) {
            case 0:
            case 1:
            case 4:
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img00_vcrom}, R.string.e630104_detail0));
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img20_vcrom}, R.string.e630104_detail2));
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img30_vcrom}, R.string.e630104_detail3));
                break;
            case 2:
            case 3:
            case 5:
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img00}, R.string.e630104_detail0));
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img10}, R.string.e630104_detail1));
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img20}, R.string.e630104_detail2));
                attr630104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630104_img30}, R.string.e630104_detail3));
                break;
        }
        map.put(0x630104, attr630104);

        FaultNavigationAttr attr630106 = new FaultNavigationAttr(R.string.e630106, 0x630106);
        switch (mt) {
            case 0:
            case 1:
            case 4:
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img00_vcrom}, R.string.e630106_detail0));
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img10_vcrom}, R.string.e630106_detail1));
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img20}, R.string.e630106_detail2));
                break;
            case 2:
            case 3:
            case 5:
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img00}, R.string.e630106_detail0));
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img10}, R.string.e630106_detail1));
                attr630106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630106_img20}, R.string.e630106_detail2));
                break;
        }
        map.put(0x630106, attr630106);

        FaultNavigationAttr attr630107 = new FaultNavigationAttr(R.string.e630107, 0x630107);
        attr630107.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630107_img00, R.drawable.e630107_img01, R.drawable.e630107_img02}, R.string.e630107_detail0));
        attr630107.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e630107_detail1));
        map.put(0x630107, attr630107);

        FaultNavigationAttr attr630108 = new FaultNavigationAttr(R.string.e630108, 0x630108);
        attr630108.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630108_img00, R.drawable.e630108_img01}, R.string.e630108_detail0));
        attr630108.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e630108_detail1));
        map.put(0x630108, attr630108);

        FaultNavigationAttr attr630109 = new FaultNavigationAttr(R.string.e630109, 0x630109);
        attr630109.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630109_img00, R.drawable.e630109_img01}, R.string.e630109_detail0));
        attr630109.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630109_img10}, R.string.e630109_detail1));
        attr630109.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630109_img20, R.drawable.e630109_img21}, R.string.e630109_detail2));
        map.put(0x630109, attr630109);

        FaultNavigationAttr attr63010a = new FaultNavigationAttr(R.string.e63010A, 0x63010A);
        attr63010a.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e63010a_img00}, R.string.e63010A_detail0));
        attr63010a.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e63010A_detail1));
        map.put(0x63010A, attr63010a);

        FaultNavigationAttr attr63010b = new FaultNavigationAttr(R.string.e63010B, 0x63010B);
        attr63010b.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e63010b_img00}, R.string.e63010B_detail0));
        attr63010b.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e63010b_img10, R.drawable.e63010b_img11}, R.string.e63010B_detail1));
        map.put(0x63010B, attr63010b);

        FaultNavigationAttr attr63010E = new FaultNavigationAttr(R.string.e63010E, 0x63010E);
        attr63010E.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e63010e_img00}, R.string.e63010E_detail0));
        attr63010E.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e63010e_img10, R.drawable.e63010e_img11}, R.string.e63010E_detail1));
        map.put(0x63010E, attr63010E);

        FaultNavigationAttr attr630201 = new FaultNavigationAttr(R.string.e630201, 0x630201);
        attr630201.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630201_img00}, R.string.e630201_detail0));
        attr630201.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e630201_img10}, R.string.e630201_detail1));
        map.put(0x630201, attr630201);

        FaultNavigationAttr attr670200 = new FaultNavigationAttr(R.string.e670200, 0x670200);
        attr670200.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e670200_img00}, R.string.e670200_detail0));
        attr670200.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e670200_img10}, R.string.e670200_detail1));
        map.put(0x670200, attr670200);

        // 主机报警
        FaultNavigationAttr attr0200FC02 = new FaultNavigationAttr(R.string.e0200FC02, 0x0200FC02);
        attr0200FC02.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0200fc02_img00}, R.string.e0200FC02_detail0));
        map.put(0x0200FC02, attr0200FC02);

        FaultNavigationAttr attr0200FC09 = new FaultNavigationAttr(R.string.e0200FC09, 0x0200FC09);
        attr0200FC09.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0200fc09_img00}, R.string.e0200FC09_detail0));
        map.put(0x0200FC09, attr0200FC09);

        FaultNavigationAttr attr0200FC0B = new FaultNavigationAttr(R.string.e0200FC0B, 0x0200FC0B);
        attr0200FC0B.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0200fc0b_img00}, R.string.e0200FC0B_detail0));
        map.put(0x0200FC0B, attr0200FC0B);

        FaultNavigationAttr attr0200FC0C = new FaultNavigationAttr(R.string.e0200FC0C, 0x0200FC0C);
        attr0200FC0C.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0200fc0c_img00}, R.string.e0200FC0C_detail0));
        map.put(0x0200FC0C, attr0200FC0C);

        FaultNavigationAttr attr0200FC0D = new FaultNavigationAttr(R.string.e0200FC0D, 0x0200FC0D);
        attr0200FC0D.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0200fc0d_img00}, R.string.e0200FC0D_detail0));
        map.put(0x0200FC0D, attr0200FC0D);

        // CBF报警
        FaultNavigationAttr attr04013308 = new FaultNavigationAttr(R.string.e04013308, 0x04013308);
        attr04013308.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e04013308_img00}, R.string.e04013308_detail0));
        attr04013308.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e04013308_img10}, R.string.e04013308_detail1));
        attr04013308.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e04013308_img20}, R.string.e04013308_detail2));
        map.put(0x04013308, attr04013308);

        FaultNavigationAttr attr0401330A = new FaultNavigationAttr(R.string.e0401330A, 0x0401330A);
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img00}, R.string.e0401330A_detail0));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img10}, R.string.e0401330A_detail1));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img20}, R.string.e0401330A_detail2));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img30}, R.string.e0401330A_detail3));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img40}, R.string.e0401330A_detail4));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330a_img50}, R.string.e0401330A_detail5));
        attr0401330A.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e0401330A_detail6));
        map.put(0x0401330A, attr0401330A);

        FaultNavigationAttr attr0401330B = new FaultNavigationAttr(R.string.e0401330B, 0x0401330B);
        attr0401330B.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330b_img00}, R.string.e0401330B_detail0));
        map.put(0x0401330B, attr0401330B);

        FaultNavigationAttr attr0401330C = new FaultNavigationAttr(R.string.e0401330C, 0x0401330C);
        attr0401330C.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330c_img00, R.drawable.e0401330c_img01}, R.string.e04013308_detail0));
        attr0401330C.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e04013308_detail1));
        attr0401330C.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e04013308_detail2));
        map.put(0x0401330C, attr0401330C);

        FaultNavigationAttr attr0401330D = new FaultNavigationAttr(R.string.e0401330D, 0x0401330D);
        attr0401330D.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e0401330d_img00}, R.string.e0401330D_detail0));
        map.put(0x0401330D, attr0401330D);

        FaultNavigationAttr attr0401330E = new FaultNavigationAttr(R.string.e0401330E, 0x0401330E);
        attr0401330E.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e0401330E_detail0));
        map.put(0x0401330E, attr0401330E);

        FaultNavigationAttr attr0401330F = new FaultNavigationAttr(R.string.e0401330F, 0x0401330F);
        attr0401330F.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{}, R.string.e0401330F_detail0));
        map.put(0x0401330F, attr0401330F);

        FaultNavigationAttr attr04014C03 = new FaultNavigationAttr(R.string.e04014C03, 0x04014C03);
        attr04014C03.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e04014c03_img00}, R.string.e04014C03_detail0));
        map.put(0x04014C03, attr04014C03);

        // 小车报警
        FaultNavigationAttr attr760000 = new FaultNavigationAttr(R.string.e760000, 0x760000);
        attr760000.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760000_img00}, R.string.e760000_detail0));
        map.put(0x760000, attr760000);

        FaultNavigationAttr attr760001 = new FaultNavigationAttr(R.string.e760001, 0x760001);
        attr760001.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760001_img00, R.drawable.e760001_img01}, R.string.e760001_detail0));
        map.put(0x760001, attr760001);

        FaultNavigationAttr attr760003 = new FaultNavigationAttr(R.string.e760003, 0x760003);
        attr760003.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760003_img00}, R.string.e760003_detail0));
        map.put(0x760003, attr760003);

        FaultNavigationAttr attr760004 = new FaultNavigationAttr(R.string.e760004, 0x760004);
        attr760004.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760004_img00}, R.string.e760004_detail0));
        map.put(0x760004, attr760004);

        FaultNavigationAttr attr760005 = new FaultNavigationAttr(R.string.e760005, 0x760005);
        attr760005.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760005_img00}, R.string.e760005_detail0));
        map.put(0x760005, attr760005);

        FaultNavigationAttr attr760006 = new FaultNavigationAttr(R.string.e760006, 0x760006);
        attr760006.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760006_img00}, R.string.e760006_detail0));
        map.put(0x760006, attr760006);

        FaultNavigationAttr attr760008 = new FaultNavigationAttr(R.string.e760008, 0x760008);
        attr760008.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760008_img00, R.drawable.e760008_img01, R.drawable.e760008_img02, R.drawable.e760008_img03}, R.string.e760008_detail0));
        map.put(0x760008, attr760008);

        FaultNavigationAttr attr76000B = new FaultNavigationAttr(R.string.e76000B, 0x76000B);
        attr76000B.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e76000b_img00, R.drawable.e76000b_img01}, R.string.e76000B_detail0));
        map.put(0x76000B, attr76000B);

        FaultNavigationAttr attr76000C = new FaultNavigationAttr(R.string.e76000C, 0x76000C);
        attr76000C.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e76000c_img00, R.drawable.e76000c_img01}, R.string.e76000C_detail0));
        map.put(0x76000C, attr76000C);

        FaultNavigationAttr attr76000D = new FaultNavigationAttr(R.string.e76000D, 0x76000D);
        attr76000D.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e76000d_img00, R.drawable.e76000d_img01}, R.string.e76000D_detail0));
        map.put(0x76000D, attr76000D);

        FaultNavigationAttr attr76000E = new FaultNavigationAttr(R.string.e76000E, 0x76000E);
        attr76000E.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e76000e_img00}, R.string.e76000E_detail0));
        map.put(0x76000E, attr76000E);

        FaultNavigationAttr attr76000F = new FaultNavigationAttr(R.string.e76000F, 0x76000F);
        attr76000F.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e76000f_img00}, R.string.e76000F_detail0));
        map.put(0x76000F, attr76000F);

        FaultNavigationAttr attr760100 = new FaultNavigationAttr(R.string.e760100, 0x760100);
        attr760100.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760100_img00}, R.string.e760100_detail0));
        map.put(0x760100, attr760100);

        FaultNavigationAttr attr760101 = new FaultNavigationAttr(R.string.e760101, 0x760101);
        attr760101.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760101_img00}, R.string.e760101_detail0));
        map.put(0x760101, attr760101);

        FaultNavigationAttr attr760102 = new FaultNavigationAttr(R.string.e760102, 0x760102);
        attr760102.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760102_img00, R.drawable.e760102_img01}, R.string.e760102_detail0));
        map.put(0x760102, attr760102);

        FaultNavigationAttr attr760103 = new FaultNavigationAttr(R.string.e760103, 0x760103);
        attr760103.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760103_img00}, R.string.e760103_detail0));
        map.put(0x760103, attr760103);

        FaultNavigationAttr attr760104 = new FaultNavigationAttr(R.string.e760104, 0x760104);
        attr760104.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760104_img00}, R.string.e760104_detail0));
        map.put(0x760104, attr760104);

        FaultNavigationAttr attr760105 = new FaultNavigationAttr(R.string.e760105, 0x760105);
        attr760105.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760105_img00}, R.string.e760105_detail0));
        map.put(0x760105, attr760105);

        FaultNavigationAttr attr760106 = new FaultNavigationAttr(R.string.e760106, 0x760106);
        attr760106.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760106_img00, R.drawable.e760106_img01}, R.string.e760106_detail0));
        map.put(0x760106, attr760106);

        FaultNavigationAttr attr760109 = new FaultNavigationAttr(R.string.e760109, 0x760109);
        attr760109.addSteps(new FaultNavigationAttr.NavigationStep(new int[]{R.drawable.e760109_img00, R.drawable.e760109_img01}, R.string.e760109_detail0));
        map.put(0x760109, attr760109);
    }
}
